package com.slz3.business.module.templateExample.temStyle1.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.templateExample.temStyle1.domain.TemStyle1;
import com.slz3.business.module.templateExample.temStyle1.domain.TemStyle1Condition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class TemStyle1ResController extends TemStyle1ResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, TemStyle1 temStyle1) {
        if (TemStyle1ResUnsafeValid.add(req, temStyle1)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$TemStyle1UpdateLock(req, temStyle1);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, TemStyle1Condition temStyle1Condition) {
        if (TemStyle1ResUnsafeValid.delete(req, temStyle1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$TemStyle1UpdateLock(req, temStyle1Condition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, TemStyle1 temStyle1) {
        if (TemStyle1ResUnsafeValid.modify(req, temStyle1)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$TemStyle1UpdateLock(req, temStyle1);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (TemStyle1ResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return temStyle1ResAtomic.info_$TemStyle1UpdateLock(req);
        if (TemStyle1ResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$TemStyle1UpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (TemStyle1ResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, TemStyle1Condition temStyle1Condition) {
        //
        if (TemStyle1ResUnsafeValid.auditSubmit(req, temStyle1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$TemStyle1UpdateLock(req, temStyle1Condition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, TemStyle1Condition temStyle1Condition) {
        if (TemStyle1ResUnsafeValid.audit(req, temStyle1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$TemStyle1UpdateLock(req, temStyle1Condition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, TemStyle1Condition temStyle1Condition) {
        if (TemStyle1ResUnsafeValid.auditReject(req, temStyle1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$TemStyle1UpdateLock(req, temStyle1Condition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, TemStyle1Condition temStyle1Condition) {
        if (TemStyle1ResUnsafeValid.usingEnable(req, temStyle1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$TemStyle1UpdateLock(req, temStyle1Condition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, TemStyle1Condition temStyle1Condition) {
        if (TemStyle1ResUnsafeValid.usingDisable(req, temStyle1Condition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$TemStyle1UpdateLock(req, temStyle1Condition);
        }
    }

}
